<?php
namespace Home\Controller;
use Think\Controller;
class SearchController extends Controller 
{
    public function index()
    {
    	$id=I('get.id/d');
    	// $data=D('goods')->where(array('cid'=>$id,'up'=>1))->select();
    	// $this->assign('data',$data);
    	$goods = D('goods');
        $data = $goods->field('goods.gname,goodsimg.gid,goodsimg.icon,goodsimg.face,goods.id,goods.cid,goods.price,goods.stock,goods.cknum,goods.sales,goods.up,goods.hot,goods.des,goods.uptime')->join('goodsimg on goods.id=goodsimg.gid')->where(array('face'=>1,'up'=>1,'cid'=>$id))->select();
        // $data=D('goods')->where(array('up'=>1,'hot'=>1))->select();
        $this->assign('data',$data);

        $list=D('Goodscategory')->where('pid=1')->select();
        
        $this->assign('list',$list);

        $this->display();
    }
}